<template>
  <div class="home-banner">
<xtx-slider :data="slidersData" />
  </div>
</template>

<script>
import { ref, onMounted } from 'vue'
import { findBanner } from '@/api/home'
export default {
  name: 'HomeBanner',
  setup () {
    const slidersData = ref([
    //   {
    //     hrefUrl: '/#/',
    //     id: '630000201807155635',
    //     imgUrl: 'http://zhoushugang.gitee.io/erabbit-client-pc-static/images/b1.jpg'
    //   },
    //   {
    //     hrefUrl: '/#/',
    //     id: '650000201207058528',
    //     imgUrl: 'http://zhoushugang.gitee.io/erabbit-client-pc-static/images/b2.jpg'
    //   }
    ])
    const geySlidersData = async () => {
      const { result } = await findBanner()
      console.log(result)
      slidersData.value = result
    }
    onMounted(() => {
      geySlidersData()
    })
    return { slidersData }
  }
}
</script>

<style scoped lang='less'>
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
</style>
